<template>
  <div>
    <p>brother2---{{ money }}{{ message }}</p>
  </div>
</template>
<script>
import bus from './bus.js'
export default {
  // 接收兄弟传的值要在钩子函数里监听$on,$emit是触发
  data () {
    return {
      money: '',
      message: ''
    }
  },
  mounted () {
    bus.$on('myevent', val => {
      console.log('兄弟2', val)
      //   如何展示
      this.money = val.money
      this.message = val.message
    })
  }
}
</script>
